package com.wing.productionPlan.model.entity;

import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.enums.IEnum;
import com.wing.mybatis.common.BaseEntity;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.math.BigDecimal;

/**
 * 生产工序表
 *
 * @author
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ord_production_process")
public class ProductionProcess extends BaseEntity<ProductionProcess> implements Serializable {

    private static final long serialVersionUID = 1L;

    public enum PieceRateStatus implements IEnum<Integer> {

        /**
        * 否
        */
        no(0,"否"),
        /**
        * 是
        */
        yes(1,"是");

        private int code;
        private String desc;

        PieceRateStatus(int code,String desc){
            this.code=code;
            this.desc=desc;
        }

        @Override
        public Integer getValue(){
            return this.code;
        }

        public String getDesc(){
            return this.desc;
        }
    }

    /**
     * 创建者
     */
    private Long creator;

    /**
     * 修改者
     */
    private Long modifier;

    /**
     * 创建人
     */
    private String creatorName;

    /**
     * 修改人
     */
    private String modifierName;

    /**
     * day
     */
    private Integer day;

    /**
     * no
     */
    private Integer no;

    /**
     * 企业编号
     */
    private String enterpriseCode;

    /**
     * 工序id
     */
    private Long processId;

    /**
     * 工序名称
     */
    private String processName;

    /**
     * 生产计划id
     */
    private Long productionPlanId;

    /**
     * 排产记录ID
     */
    private Long productionPlanRecordId;

    /**
     * 是否计件工资
     */
    private PieceRateStatus pieceRateStatus;

    /**
    * 是否计件工资描述
    */
    @TableField(exist = false)
    private String pieceRateStatusDesc;

    public String getPieceRateStatusDesc() {
        return pieceRateStatus == null ? null : pieceRateStatus.getDesc();
    }

    /**
     * 计件工资
     */
    private BigDecimal pieceRate;

    /**
     * 设备类型组(工序排产所属 用，隔开)
     */
    private String deviceTypes;

}
